/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.qdu.service.impl;

import com.qdu.dao.impl.PublicActivityDaoImpl;
import com.qdu.entity.PublicActivity;
import java.util.List;
import com.qdu.service.PublicActivityService;
import com.qdu.dao.PublicActivityDao;

/**
 *
 * @author Daniel
 */
public class PublicActivityServiceImpl implements PublicActivityService{
    PublicActivityDao publicDao = new PublicActivityDaoImpl();
    @Override
    public int submitNewPublic(PublicActivity p) {
        return publicDao.insert(p);
    }

    @Override
    public int modifyPublicSituation(PublicActivity p) {
        return publicDao.update(p);
    }

    @Override
    public int deletePublic(int Pno) {
        return publicDao.deleteByPno(Pno);
    }

    @Override
    public List<PublicActivity> displayAllPublic() {
        return publicDao.getAll();
    }
    
    
    
    @Override
    public List<PublicActivity> findPublicActivityByKeyword(String Ptopic) {
        return publicDao.getActivityByKeyword(Ptopic);
    }

    @Override
    public PublicActivity findActivityById(int Pno) {
        PublicActivity pa =publicDao.getOneByPno(Pno);
        return pa;
    }

    @Override
    public int joinActivity(PublicActivity p) {
        return publicDao.join(p);
    }

    @Override
    public List<PublicActivity> findPublicActivityByUno(int Uno) {
    return publicDao.getActivityByUno(Uno);
    }
    

}
